<% @main_header = "#{link_to('Ptrack:', '/')} #{@project.name if @project}: Notes" %>

<style type="text/css">
	#notes-show-msgHeader{
		border-bottom:1px solid #DDDDDD;
		margin-bottom:14px;
		overflow:hidden;
		padding-bottom:5px;
	}
	#notes-show-msgHeader h2{
		border:medium none;
		color:#000000;
		font-size:18px;
		margin:0 0 5px;
		font-family:"Lucida Grande",arial,sans-serif;
		padding:0;
	}
	#notes-show-msgHeader p{
		font-size:12px;
		line-height:140%;
		margin:0;
	}
	#notes-show-msgHeader p span{
		color:#999999;
		margin-right:8px;
		width:30px;
	}
	#notes-show-body{
		margin-bottom:10px;
		padding-bottom:15px;
		font-size:14px;
		line-height:1.4em;
		margin:3px 0 10px;
		padding:0;
	}
</style>

<div style="float: left; width: 100%;">
<fieldset>
	<legend>Note Details</legend>
	
	<div id="notes-show-msgHeader">
		<h2><%=h @note.title %></h2>
		<p>
			<span>From: </span>
			<%= @note.user.nil? ? "Anonymous" : link_to( h(@note.user.full_name), {:controller => "users", :action => "show", :id => @note.user.id}) %>
		</p>
		<p>
			<span>Project: </span>
			<%= @note.project.nil? ? "Project Not Specified" : link_to(h(@note.project.name), {:controller => "projects", :id => @note.project.id}) %>
		</p>
		<p>
			<span>Date: </span>
			<%= @note.updated_at.strftime("%d.%m.%Y at %H:%M") %>
		</p>
		<p>
			<span>Category: </span>
			Not Specified
		</p>
		<p>
			<span>Related Contacts: </span>
			<% if @note.contacts.empty? %>
					Contact Not Specified 
				<%else%>
					<% if(@note.contacts.length == 1) %>
						<% @note.contacts.each{|contact| %>
							<%= link_to h(contact.full_name), :controller => "contacts", :action => "show", :id => contact.id %>
						<% } %>
					<% else %>
						<% @note.contacts.each{|contact| %>
							<%= link_to h(contact.full_name), :controller => "contacts", :action => "show", :id => contact.id %>, 
						<% } %>
					<% end %>
				<%end%>  
		</p>
	</div>
	<div id="notes-show-body">
		<%= @note.body.gsub(/\n/, '<br>') %>
	</div>
</fieldset>
<p>
<%= link_to 'Previous page', :action => "list" %>
</p>
</div>


